package com.xiaoxing.zhinenghuacangku_liaocheng.mvp.model;

import android.app.Application;

import com.google.gson.Gson;
import com.jess.arms.di.scope.ActivityScope;
import com.jess.arms.integration.IRepositoryManager;
import com.jess.arms.mvp.BaseModel;
import com.xiaoxing.zhinenghuacangku_liaocheng.mvp.model.entity.MaterialList;
import com.xiaoxing.zhinenghuacangku_liaocheng.mvp.model.service.ZhiNengCangKuService;
import com.xiaoxing.zhinenghuacangku_liaocheng.mvp.contract.LiaoCheng_StorageContract;

import java.util.Map;

import javax.inject.Inject;

import io.reactivex.Observable;


@ActivityScope
public class LiaoCheng_StorageModel extends BaseModel implements LiaoCheng_StorageContract.Model {
    @Inject
    Gson mGson;
    @Inject
    Application mApplication;

    @Inject
    public LiaoCheng_StorageModel(IRepositoryManager repositoryManager) {
        super(repositoryManager);
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        this.mGson = null;
        this.mApplication = null;
    }

    @Override
    public Observable<MaterialList> materialList(String product_id) {
        return null;
    }

    @Override
    public Observable<String> getDistributeList(String user_id, String orderNo, String projectName, String material, String projectNo, String sname) {
        return mRepositoryManager.obtainRetrofitService(ZhiNengCangKuService.class).getDistributeList(user_id, orderNo, projectName, material, projectNo, sname);
    }

    @Override
    public Observable<String> getUserSpaceListForAutoStore(String user_id, String spname) {
        return mRepositoryManager.obtainRetrofitService(ZhiNengCangKuService.class).getUserSpaceListForAutoStore(user_id, spname);
    }

    @Override
    public Observable<String> createMaterialForInstoreAuto(Map<String, String> params) {
        return mRepositoryManager.obtainRetrofitService(ZhiNengCangKuService.class).createMaterialForInstoreAuto(params);
    }

    @Override
    public Observable<String> setInstoreBufferReadyForAGV(String bufferId,String spid) {
        return mRepositoryManager.obtainRetrofitService(ZhiNengCangKuService.class).setInstoreBufferReadyForAGV(bufferId,spid);

    }

    @Override
    public Observable<String> addAgvTask(String mid, String instoreBufferId, String spid, String num, String uid, String remark) {
        return mRepositoryManager.obtainRetrofitService(ZhiNengCangKuService.class).addAgvTask(mid, instoreBufferId, spid, num, uid, remark);
    }

    @Override
    public Observable<String> cancelBufferReadyForAGV(String bufferId) {
        return mRepositoryManager.obtainRetrofitService(ZhiNengCangKuService.class).cancelBufferReadyForAGV(bufferId);

    }
//    @Override
//    public Observable<String> createMaterialForInstoreAuto(  RequestBody did,
//                                                             RequestBody uid,
//                                                             RequestBody num,
//                                                             MultipartBody.Part imgStr) {
//        return mRepositoryManager.obtainRetrofitService(ZhiNengCangKuService.class).createMaterialForInstoreAuto(did, uid, num, imgStr);
//    }
}